package com.zzxx.wechat.common.enums;


import lombok.Getter;

@Getter
public enum DiscountPriceEnum {

    ZH_DISCOUNT_PRICE("ZH", "discount_price_ca"),
    CA_DISCOUNT_PRICE("CA", "discount_price_ca"),
    US_DISCOUNT_PRICE("US", "discount_price_us"),
    GB_DISCOUNT_PRICE("GB", "discount_price_gb");

    private final String country;
    private final String code;

    DiscountPriceEnum(String country, String code) {
        this.country = country;
        this.code = code;
    }


    public static String getCodeByCountry(String country) {
        for (DiscountPriceEnum value : DiscountPriceEnum.values()) {
            if (value.getCountry().equals(country)) {
                return value.getCode();
            }
        }
        return null;
    }
}
